#ifndef MASTER_MASTER_H
#define MASTER_MASTER_H

#include <thread>
#include <atomic>
using namespace std;

class Master{
private:
    std::thread taskThread; //启动上层站点
    std::thread brokerThread;   //启动broker服务
    std::thread mdnsServiceThread;  //启动mdns服务
    std::thread mqttClientThread;   //启动mqtt客户端
    std::atomic<bool> allowRunning {false}; //是否允许运行

public:
    Master() = default;

    void start();

    void stop();

    // 启动上层站点
    void taskThreadFunc();

    // 启动broker服务
    void brokerThreadFunc();

    // 启动mdns服务
    void mdnsServiceThreadFunc();

    // 启动mqtt客户端
    void mqttClientThreadFunc();
};




#endif